I have a select-pulldown at http://computergroupplays.com/fb-pres2.asp
that changes the 3rd pulldown (Dbase) depending on what the user
enters in the 2nd (Wk). My associate wants the values inside the
select box to retain their values after hitting the Go-Submit button
when selecting the 3 choices- they want to see the values retained on
the next page when you look at the form. Below is the include file
used to generate the dynamic pulldown value for the 3rd pulldown:
<script language="Javascript">
var arrayData = new Array();
arrayData[0] = '1|LY-YrToDate|'
arrayData[1] = '1|LY-Last8wk|'
arrayData[2] = '2|LY-YrToDate|'
arrayData[3] = '2|LY-Last8wk|'
arrayData[4] = '3|Avg(YrTD-LY)|'
arrayData[5] = '4|YrToDate|'
arrayData[6] = '5|YrToDate|'
arrayData[7] = '6|YrToDate|'
arrayData[8] = '7|YrToDate|'
arrayData[9] = '8|YrToDate|'
arrayData[10] = '8|Rolling-6wk|'
arrayData[11] = '9|YrToDate|'
function populateData( name ) {
select = window.document.form.DBCode;
string = "";
// 0 - will display the new options only
// 1 - will display the first existing option plus the new options
count = 0;
// Clear the old list (above element 0)
select.options.length = count;
// Place all matching categories into Options.
for( i = 0; i < arrayData.length; i++ ) {
string = arrayData[i].split( "|" );
if( string[0] == name ) {
select.options[count++] = new Option( string[1] );
}
}
}
</script>
===
.....and the html in the form:
<form name="form" method="post" action="fb-query-post6.asp">
<td height="114" valign="top"
background="images/wayback.jpg" width="359"><p><br>
<br>
</p>
<p> <font color="#FF9900" size="2">Yr</font>
<select name="season" STYLE="font-family : monospace;
font-size : 7.5pt"><option></option>
<option value="2003">2003</option>
<option value="2002">2002</option>
<option value="2001">2001</option>
</select>
<font color="#FF9900" size="2">Wk#</font>
<select name="gameweek" size=1 STYLE="font-family :
monospace;
font-size : 7.5pt"
onChange='javascript:populateData(
this.options[selectedIndex].text )'>
<option></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
</select>
<font color="#FF9900" size="2">DBase
<select name="DBCode" STYLE="font-family : monospace;
font-size : 7.5pt">
</select>
<input name="submit" type="submit" class="inputSubmit"
value="Go" size="8" align="absbottom">
</form>
using option value "selected" gives this scenario problems. Any remedy
into what I'm suggesting, or is it possible?
thx
Cgplays.com